﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/LeftToolbarContent.Master" AutoEventWireup="true" Inherits="iSun.Web.SysPage.SampleListPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        var grid, store, dataStore; //用于dojo.common.list.base.js
        var _cells = [<%=DojoDataFields %>];
//        require([
//			"dojo",
//	        "dojo/store",
//			"dijit/dijit",
//			"dijit/dijit-all",
//			"dojo/parser",
//			"dojo/date/locale",
//			"dojo/data/ItemFileReadStore", //读缓存对象
//          "dojo/data/ItemFileWriteStore", //写缓存对象
//          "dojox/grid/_CheckBoxSelector",
//			"dojo/dnd/Source"]);
        var _ViewStructure = [
			  {
			      noscroll: false,
			      defaultCell: { width: "84px" },
			      cells:_cells 
			  }
			];          //列表结构
			var _dataJSON = "dtlist.xhjson?entity=<%=EntityName %>&functionid=<%=Function %>&condition=<%=Condition%>";


    </script>
    <script src="../_Scripts/dojo.common.list.base.js" type="text/javascript"></script>
    <script type="text/javascript">
        require([
				"dojox/grid/DataGrid",
				"dojo/store/Memory",
				"dojo/data/ObjectStore",
				"dojo/_base/xhr",
                "dojox/grid/cells", "dojo/_base/array", "dojo/_base/lang", "dojox/grid/_CheckBoxSelector", "dojox/grid/_RadioSelector",
				"dojo/domReady!"
			], function (DataGrid, Memory, ObjectStore, xhr) {
			    xhr.get({
			        url: _dataJSON,
			        handleAs: "json"
			    }).then(function (data) {
			        _store = new Memory({ data: data.items });
			        _dataStore = new ObjectStore({ objectStore: store });

			        _grid = new DataGrid({
			            store: dataStore,
			            query: {id: "*" },
			            structure: [
			            // First, our view using the _CheckBoxSelector custom type
					        {
					        type: "dojox.grid._CheckBoxSelector"
					    },
                            [_cells]]
					}, "_menuGrid");

			        // since we created this grid programmatically, call startup to render it
			        _grid.startup();
			    });
			});
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="toolbar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPlace" runat="server">
   <div id="_menuGrid"> </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="LeftData" runat="server">
   <div id="grid"></div>
</asp:Content>
